<template>
  <el-dialog title="详情" :visible.sync="visible" @close="$emit('update:visible', false)" destroy-on-close>
    <el-form :model="content" label-width="120px" inline label-position="left">
      <el-form-item prop="imgUrl" label="商品图片">
        <div class="userCk">
          <el-avatar size="large" :src="content.imgUrl" shape="square"></el-avatar>
        </div>
      </el-form-item>
      <el-form-item prop="showState" label="上架状态">
        <div class="userCk">
          {{getDictLabel('show_state', content.showState)}}
        </div>
      </el-form-item>
      <el-form-item prop="id" label="商品ID">
        <div class="userCk">
          {{content.id}}
        </div>
      </el-form-item>
      <el-form-item prop="productName" label="商品名称">
        <div class="userCk">
          {{content.productName}}
        </div>
      </el-form-item>
      <el-form-item prop="productDesc" label="商品描述">
        <div class="userCk">
          {{content.productDesc}}
        </div>
      </el-form-item>
      <el-form-item prop="groupName" label="商品分类">
        <div class="userCk">
          {{content.groupName}}
        </div>
      </el-form-item>
      <el-form-item prop="price" label="商品价格">
        <div class="userCk">
          {{formatNumber(content.price)}}
        </div>
      </el-form-item>
      <el-form-item prop="marketPrice" label="划线价格">
        <div class="userCk">
          {{formatNumber(content.marketPrice)}}
        </div>
      </el-form-item>
<!--      <el-form-item prop="stock" label="库存数量">-->
<!--        <div class="userCk">-->
<!--          {{formatNumber(content.stock,true)}}-->
<!--        </div>-->
<!--      </el-form-item>-->
      <el-form-item prop="sold" label="已售数量">
        <div class="userCk">
          {{formatNumber(content.sold,true)}}
        </div>
      </el-form-item>
      <el-form-item prop="createDate" label="创建时间">
        <div class="userCk">
          {{content.createDate}}
        </div>
      </el-form-item>
    </el-form>
    <template slot="footer">
      <el-button @click="$emit('update:visible', false)">取消</el-button>
    </template>
  </el-dialog>
</template>
<script>
import {formatNumber, getDictLabel} from "@/utils";

export default {
  name: 'ComProductList',
  data() {
    return {}
  },
  props: {
    content:Object,
    visible:Boolean
  },
  methods: {
    formatNumber,
    getDictLabel
  }
}
</script>
<style>
  .userCk{
    width: 260px;
    font-weight: 700;
  }
</style>
